-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add session storage clustering support #3555
Conversation
586e3c9
to
88cdf94
Compare
88cdf94
to
39aa9aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the clustering e2e-test, maybe you can spin up a second nuts node (same organization) and run the test against both (round robin)?
########## | ||
|
||
With the introduction of a SQL database and separate session storage, clustering with HA is now possible. | ||
Clustering is currently limited to nodes that have the ``did:nuts`` method disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe state what NOT to do (use default on-disk/in-memory stores for private keys and stuff)?
e2e-tests/clustering/redis/node-A/presentationexchangemapping.json
Outdated
Show resolved
Hide resolved
Do we need/have something in diagnostics on the session store? |
there's no |
The |
results["session"] = core.Health{ | ||
Status: core.HealthStatusUp, | ||
} | ||
err := e.sessionDatabase.GetStore(defaultSessionDataTTL, "healthcheck").Get("does_not_exist", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope so :-p
// StringOrBytes is a type that can be either a string or a byte slice | ||
// used for generic type constraints | ||
type StringOrBytes interface { | ||
~string | ~[]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow... is this Go?
|
||
// NewMemcachedSessionDatabase creates a new MemcachedSessionDatabase using an initialized memcache.Client. | ||
func NewMemcachedSessionDatabase(client *memcache.Client) *MemcachedSessionDatabase { | ||
memcachedStore := memcachestore.NewMemcache(client, store.WithExpiration(defaultSessionDataTTL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use the same value for access token lifetime? Or at least, the token lifetime shouldn't be longer than this default. Having 2 seeminly unrelated constants (but secretly relating) seems rather dangerous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment. Memcached requires a default setting. We override this value when writing with the TTL of the store.
closes #3553